package com.hdit.guimei.service.impl;

import com.hdit.guimei.domain.Goods;
import com.hdit.guimei.domain.Seckill;
import com.hdit.guimei.mapper.SeckillMapper;
import com.hdit.guimei.service.SeckillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @基本功能:
 * @ClassName: SeckillService
 * @Description: TODO
 * @Author: 李嘉明
 * @Date: 2021/1/18 10:22
 * @Version 1.0
 */
@Service
public class SeckillServiceImpl implements SeckillService {
    @Autowired
    public SeckillMapper seckillMapper;
    /**
     *@methodName  findseckillgoods
     *@方法功能描述：查看秒杀时间段下的所有商品
     *@params  [start_time, end_time]
     *@return  java.util.List<com.hdit.guimei.domain.Goods>
     *@author   张宝玉
     *@Date    2021/1/20 14:30
     */
    @Override
    public List<Goods> findseckillgoods(Date start_time, Date end_time) {
        List<Goods> goodsList = seckillMapper.findgooodsinseckill(start_time, end_time);
        return goodsList;
    }
    /**
     *@methodName  addgoodinseckill
     *@方法功能描述：添加秒杀时段下的商品
     *@params  [seckill]
     *@return  int
     *@author   张宝玉
     *@Date    2021/1/20 15:22
     */
    @Override
    public int addgoodinseckill(Seckill seckill) {
        int i = seckillMapper.addgoodinseckill(seckill);
        return i;
    }

    @Override
    public int delegoodseckill(int good_id) {
        int i = seckillMapper.delegoodinseckil(good_id);
        return i;
    }
}
